<%unless params[:submit].nil?-%>
        <%if params[:submit]=="renew"%>
            <div style="padding:10px;">
              <%@i=0%>
              <%10.times{-%>
              <%
                unless [:dfo][@i].nil?
                 @advertisment           = Advertisment.find(params[:dfo][@i])
                 @sub_category_lifespan  = @advertisment.sub_category.lifespan
                 @expires= Date.today + @sub_category_lifespan.days
                 Advertisment.update(@advertisment,:expires_at=> @expires.to_formatted_s(:long_ordinal))
                end
              %>
              <%@i=@i+1 -%>
              <%}-%>
              <div class="back-to-ads">
              <%=link_to image_tag("back-to-ads2.jpg",:border=>"0"),:action=>"recently_posted_ads"-%><br /><br />
              </div>
              <h4 style="clear:both">Advertisments Renewed</h4>
            </div>
        <%end -%>

        <%if params[:submit]=="delete"%>
            <div style="padding:10px;">
              <%@i=0%>
              <%10.times{-%>
              <%unless [:dfo][@i].nil?%>
              <%Advertisment.delete(params[:dfo][@i])%>
              <%end -%>
              <%@i=@i+1 -%>
              <%}-%>
              <div class="back-to-ads">
              <%=link_to image_tag("back-to-ads2.jpg",:border=>"0"),:action=>"recently_posted_ads"-%><br /><br />
              </div>
              <h4 style="clear:both">Advertisments Deleted!</h4>
            </div>
        <%end -%>

<%end -%>